<template>
  <van-cell class="article-item" :to="`/article/${Article.art_id}`">
    <!-- 标题区域 -->
    <div slot="title" class="title van-multi-ellipsis--l2">{{ Article.title }}</div>
    <!-- 下方图片区域 -->
    <div slot="label">
      <div v-if="Article.cover.type === 3" class="cover-wrap">
        <div class="cover-item" v-for="(img, index) in Article.cover.images" :key="index">
          <van-image class="cover-item-img" fit="cover" :src="img" />
        </div>
      </div>
    </div>
    <!-- 评论区域 -->
    <div slot="label" class="article-item">
      <div>
        <span>{{ Article.aut_name }}</span>
        <span>{{ Article.comm_count }}评论</span>
        <span>{{ Article.pubdate | relativeTime }}</span>
      </div>
    </div>
    <!-- 右侧图片 -->
    <van-image class="right-img" slot="default" v-if="Article.cover.type === 1" fit="cover" :src="Article.cover.images[0]" />
  </van-cell>
</template>

<script>
export default {
  name: 'article-index',
  props: {
    Article: {
      type: Object,
      require: true
    }
  },
  data() {
    return {}
  },
  created() {},
  methods: {}
}
</script>

<style lang="less" scoped>
.van-cell__value {
  width: 232px;
  height: 164px;
  flex: unset;
  padding-left: 25px;
  .right-img {
    width: 232px;
    height: 164px;
  }
}
.title {
  font-size: 32px;
  color: #3a3a3a;
}
.article-item span {
  margin-right: 15px;
  color: #b4b4b4;
}
.cover-wrap {
  display: flex;
  padding: 30px 0;
  .cover-item {
    flex: 1;
    &:not(:last-child) {
      padding-right: 4px;
    }
    .cover-item-img {
      width: 100%;
      height: 164px;
    }
  }
}
</style>
